<?php

namespace App\Http\Requests;

use App\Http\Requests\BaseFormRequest;

class DeviceParamsRequest extends BaseFormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    public function scenes()
    {
        return [

			'update'=>[
                'data.*.t_uart_id' => 'required|integer',
                'data.*.t_uart_buad' => 'required|integer',
                'data.*.t_uart_stop_bit' => 'required|integer',
                'data.*.t_uart_data_bit' => 'required|numeric',
                'data.*.t_uart_check_bit' => 'required|integer',
			]
        ];
    }
	
	public function messages()
    {
        return [
            'data.*.t_uart_id'=> [
                'required' => '串口号必须',
                'integer' => '串口号必须是数字',
            ],
            'data.*.t_uart_buad'=> [
                'required' => '波特率必须',
                'integer' => '波特率必须是数字',
            ],
            'data.*.t_uart_data_bit'=> [
                'required' => '数据位必须',
                'integer' => '数据位必须是数字',
            ],
            'data.*.t_uart_stop_bit'=> [
                'required' => '停止位必须',
                'integer' => '停止位必须是数字',
            ],
            'data.*.t_uart_check_bit'=> [
                'required' => '校验位必须',
                'integer' => '校验位必须是数字',
            ],

        ];
    }
}
